<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Person
 *
 * @author TOP   SYSTEM
 */


class Person {
    //put your code here
  //  public $name;
    public function View_Product(){
      $con=mysqli_connect("localhost","root","","book_market");
// Check connection
if (mysqli_connect_errno())
  {
 echo "Failed to connect to MySQL: " . mysqli_connect_error();
 }
 $result = mysqli_query($con,"SELECT * FROM product ");
  
//$name=$w['Product_Name'];
//$price=$w['Price'];
while ($w=mysqli_fetch_array($result)){

echo'
<div class="templatemo_product_box">
                    <h1>' .$w['Product_Name'].'  </h1>
   	      <img src="images/'.$w['Image_Src'].'" alt="image" />
                <div class="product_info">
                	<p>'.$w['Description'].'</p>
                            <table><tr>
               <td>   <h2> Quantity : '.$w['Quantity'].' </h2> </td>
              <td>    <h3> / '.$w['Price'].' $ </h3></td></tr>   
                   </table>
                  <div class="buy_now_button"><a href="Update_Product.php?id='.$w['Product_Id'].'">Update it</a></div>
               <div class="buy_now_button"><a href="Delete_Product.php?id='.$w['Product_Id'].'">Delete it</a></div>
                </div>
                <div class="cleaner">&nbsp;</div>
            </div>    
';

}
 mysqli_close($con);
    }
   
}

?>
